<template>
  <div class="page">
    <headerTItle :CNtitle="`下载中心`" :ENtitle="`DOWNLOAD CENTER`"></headerTItle>
    <div class="oneBox display">
        <div v-for="item in downloadList" :key="item.id" class="downloadItem" >
          <img :src="item.img" alt="">
          <div class="downloadInfo">
            <p class="title">—{{item.title}}—</p>
            <p class="desc" v-if="item.exhibit_one">{{item.exhibit_one.name}}</p>
          </div>
          <div class="readMore">
            <el-button class="downloadBtn" type="primary" size="medium" @click="handleClick(item)">点击下载</el-button>
          </div>
      
      </div>
    </div>
  </div>
</template>

<script>
import headerTItle from "@/components/headerTItle.vue";
import { getDownloadList } from '@/api/index'
export default {
  components: {
    headerTItle,
  },
  data() {
    return {
      downloadList: [],
    };
  },
  created() {
    getDownloadList({code: 'fb'}).then(res => {
      this.downloadList = res.data;
    })
  },
  methods: {
    handleClick(item) {
      window.open(item.url);
    }
  },
};
</script>

<style scoped lang="scss">
.oneBox{
 justify-content: space-between;
 align-items: center;
 .downloadItem{
  position: relative;
  img{
    width: 23.4375rem;
    height: 35.125rem;
    object-fit: cover;
    display: flex;
    margin-bottom:2.8125rem;

  }
  .downloadInfo{
    margin: 2.8125rem 0;
    p{
      margin: 0;
      text-align: center;
    }
  }
  .readMore{
    width: 100%;
    display: flex;
    justify-content: center;
    .downloadBtn{
      width: 12.5rem;
      height: 3.3125rem;
      font-size: 1.25rem;
      border-radius: 0.5rem;
    }
  }
 }
}
</style>
